Skip to content

fix(sdk/trace): cache TracerMetrics on TracerProvider to prevent memory leak#5027

Open
ravitheja4531-cell wants to merge 2 commits intoopen-telemetry:mainfrom
ravitheja4531-cell:fix-memory-leak
Open

fix(sdk/trace): cache TracerMetrics on TracerProvider to prevent memory leak#5027
ravitheja4531-cell wants to merge 2 commits intoopen-telemetry:mainfrom
ravitheja4531-cell:fix-memory-leak

Conversation

@ravitheja4531-cell
Copy link
Copy Markdown

Description

Fixes #5016

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

All 230 existing SDK trace tests pass locally.

Does This PR Require a Contrib Repo Change?

  • No.

Checklist

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Copy link
Copy Markdown
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I feel that instead of complicating the tracer we should probably make get_meter cheap instead. Now that the tracer is cached also this should be an issue anymore.

@xrmx xrmx moved this to Reviewed PRs that need fixes in Python PR digest Apr 1, 2026
@ravitheja4531-cell ravitheja4531-cell requested a review from xrmx April 6, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Reviewed PRs that need fixes

Development

Successfully merging this pull request may close these issues.

Repeated calls to get_tracer results in memory leak in 1.40.0

2 participants